package com.yanfan.energy.domain.enums;

/**
 * @Author huan
 * @Description 工单管理-工单状态
 * @ClassName 2023年01月09日 14:27:00
 * @Version 1.0
 **/
public class ProductionStaffEnums {

    public enum SexEnums {
        MAN(0, "男"), WOMAN(1, "女"), UNKNOWN(2, "未知");


        private Integer code;

        private String desc;

        SexEnums(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        /**
         * 根据枚举type 返回String类型
         *
         * @param type
         * @return
         */
        public static String getEnumByType(Integer type) {
            for (SexEnums item : SexEnums.values()) {
                if (item.getCode().equals(type)) {
                    return item.getDesc();
                }
            }
            throw new RuntimeException("通过type获取枚举类时出现异常！");
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    /**
     * 生产情况  0 是下线  1   上线
     **/
    public enum ProductionStateEnums {
        WOMAN(0, "下线"), UNKNOWN(1, "上线");


        private Integer code;

        private String desc;

        ProductionStateEnums(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        /**
         * 根据枚举type 返回String类型
         *
         * @param type
         * @return
         */
        public static String getEnumByType(Integer type) {
            for (ProductionStateEnums item : ProductionStateEnums.values()) {
                if (item.getCode().equals(type)) {
                    return item.getDesc();
                }
            }
            return "";
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }


}
